package com.shameit.goodqrinfomanager.ui.activity.setting;

import androidx.appcompat.app.AppCompatActivity;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelProviders;

import android.os.Bundle;

import com.shameit.goodqrinfomanager.AppViewModelFactory;
import com.shameit.goodqrinfomanager.BR;
import com.shameit.goodqrinfomanager.BaseMVVMActivity;
import com.shameit.goodqrinfomanager.MyApplication;
import com.shameit.goodqrinfomanager.R;
import com.shameit.goodqrinfomanager.databinding.ActivityBaseicSettingBinding;

import me.goldze.mvvmhabit.base.BaseActivity;
import me.goldze.mvvmhabit.utils.SPUtils;

public class BaseicSettingActivity extends BaseMVVMActivity<ActivityBaseicSettingBinding,BaseicSettingViewModel> {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setToolBarBack(binding.toolbar);
    }

    @Override
    protected String setTitle() {
        return "基本设置";
    }

    @Override
    protected void initView() {

    }

    @Override
    protected void loadData() {
        binding.basicIpAddress.setText(SPUtils.getInstance().getString(MyApplication.BaseUrl,"http://47.96.71.26:8888"));
    }

    @Override
    public int initContentView(Bundle savedInstanceState) {
        return R.layout.activity_baseic_setting;
    }

    @Override
    public int initVariableId() {
        return BR.data;
    }

    @Override
    public BaseicSettingViewModel initViewModel() {
        AppViewModelFactory factory = AppViewModelFactory.getInstance(getApplication());
        return ViewModelProviders.of(this, factory).get(BaseicSettingViewModel.class);
    }
}